home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earcd / comm / ums / pint.lha / UMS / Rexx / ApproveMsg.pint < prev    next >
Text File  |  1997-03-04  |  2KB  |  80 lines

  1. /*
  2.  
  3.    $VER: ApproveMsg.pint 1.0 (15.3.96)
  4.  
  5.    Author:
  6.     Matthias Scheler <tron@lyssa.owl.de>
  7.  
  8.    Updated for PINT (22.2.97):
  9.     Magnus Heino (nd95mho@Student.HGS.SE)
  10.  
  11.    Thanks:
  12.     Kai Bolay <kai@studbox.uni-stuttgart.de>
  13.  
  14.    Function:
  15.     adds RFC "Approved:" header to a message
  16.  
  17.    History:
  18.     1.0   Initial version.
  19.  
  20.    Requires:
  21.     UMS, PINT 2.0
  22.  
  23.    Example for "ums.config":
  24.     ( PINT.Rexx
  25.     ...
  26.         "#?Window F7 ApproveMsg.pint\n"
  27.     ...
  28.     )
  29.  
  30. */
  31.  
  32. OPTIONS RESULTS
  33.  
  34. CALL ADDLIB('ums.library',0,-210,11)
  35. CALL UMSInitConsts()
  36.  
  37. STATUS
  38. IF RESULT~='MESSAGE' THEN EXIT 5
  39.  
  40. GETACCOUNT
  41. OldAccount=RESULT
  42.  
  43. Account=UMSDupAccount(OldAccount)
  44.  
  45. GETMSGNUM
  46. AppMsgNum=RESULT
  47.  
  48. DROP Message.
  49.  
  50. IF UMSReadMsgAll(Account,AppMsgNum,Message.,TRUE) THEN
  51.  DO
  52.   IF Symbol('Message.UMSCODE_GROUP')='VAR' THEN
  53.    DO
  54.     IF UMSReadMsgInfo(Account,AppMsgNum,info.) THEN
  55.      DO
  56.       IF BitTst(info.USERSTAT,UMSUSTAT_OWNER) THEN
  57.        DO
  58.         User=UMSReadConfig(Account,"rfc.username")
  59.         IF User="" THEN User="nobody"
  60.  
  61.         Domain=UMSReadConfig(Account,"rfc.domainname")
  62.         IF Domain="" THEN Domain="no.where"
  63.  
  64.         'REQUEST "ApproveMsg" "**_Yes|No" "Approve this message?"'
  65.         IF RESULT=1 THEN
  66.          DO
  67.           Message.UMSCODE_RFCATTR='"Approved: '||User||'@'||Domain||'"'
  68.           Message.MSGNUM         =AppMsgNum
  69.  
  70.           IF UMSWriteMsg(Account,Message.)~=0 THEN REDISPLAY
  71.           ELSE 'REQUEST "ApproveMsg" "**_OK" "Approve failed!"'
  72.          END
  73.        END
  74.       ELSE 'REQUEST "ApproveMsg" "**_OK" "You are not the owner of this message!"'
  75.      END
  76.    END
  77.  END
  78.  
  79. CALL UMSLogout(Account)
  80.